<?php


class BinaryOperator
{
    const ADD = '+';
    const ASSIGN = '=';
    const BITWISE_AND = '&';
    const BITWISE_OR = '|';
    const BITWISE_SHIFT_LEFT = '<<';
    const BITWISE_SHIFT_RIGHT = '>>';
    const BITWISE_XOR = '^';
    const BOOLEAN_AND = '&&';
    const BOOLEAN_OR = '||';
    const DIVIDE = '/';
    const GREATER_THAN = '>';
    const GREATER_THAN_OR_EQUAL = '>=';
    const IDENTITY_EQUALITY = '===';
    const IDENTITY_INEQUALITY = '!==';
    const INSTANCE_OF = 'instanceof';
    const KEY_VALUE = '=>';
    const LESS_THAN = '<';
    const LESS_THAN_OR_EQUAL = '<=';
    const LOGICAL_XOR = 'xor';
    const MODULUS = '%';
    const MULTIPLY = '*';
    const SUBTRACT = '-';
    const VALUE_EQUALITY = '==';
    const STRING_CONCATENATION = '.';
    
    static public function Defines($const)
    {
        $cls = new ReflectionClass(__CLASS__);
        foreach($cls->getConstants() as $key=>$value)
        {
            if($value == $const)
            {
                return true;
            }
        }
        
        return false;
    }
}

?>
